import Vue from 'vue'

import 'normalize.css/normalize.css'
import 'element-ui/lib/theme-chalk/index.css'
import i18n from './lang'
import Element from 'element-ui'

import '@/styles/index.scss'

import App from './App'
import store from './store'
import router from './router'

import '@/icons'
import '@/permission'
import vPermission from '@/directive/permission'
import Pagination from '@/components/Pagination'

// import vDragDialog from '@/directive/el-drag-dialog'

if (process.env.NODE_ENV === 'production') {
  const { mockXHR } = require('../mock')
  mockXHR()
}

Vue.use(Element, {
  // size: Cookies.get('size') || 'medium', // set element-ui default size
  i18n: (key, value) => i18n.t(key, value)
})

Vue.component('Pagination', Pagination)

Vue.config.productionTip = false
Vue.directive('permission', vPermission)
// Vue.directive('el-drag-dialog', vDragDialog)

new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: h => h(App)
})
